import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JButton;

import java.awt.CardLayout;
import java.awt.Container;
import java.awt.Window;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class MockLogin extends JPanel {

	/**
	 * Create the panel.
	 */
	public MockLogin() {
	
		JLabel lblMockLogin = new JLabel("Mock Login");
		
		JButton btnTeacherMode = new JButton("Teacher Mode");
		btnTeacherMode.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				// gets parent panel
				JPanel parent = (JPanel) javax.swing.SwingUtilities.getAncestorOfClass(JPanel.class, MockLogin.this);
				parent.add(new TeacherModeGui(), "teachermode");
				// Show TeacherModeGui
				
				CardLayout layout = (CardLayout)(parent.getLayout());
				layout.show(parent, "teachermode");
			}
		});
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(132)
							.addComponent(lblMockLogin))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(98)
							.addComponent(btnTeacherMode)))
					.addContainerGap(235, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(54)
					.addComponent(lblMockLogin)
					.addGap(100)
					.addComponent(btnTeacherMode)
					.addContainerGap(101, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
